package com.wan.personnel2.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wan.personnel2.entity.EmployeeInf;
import com.wan.personnel2.dao.EmployeeInfMapper;
import com.wan.personnel2.entity.ResultCode;
import com.wan.personnel2.service.EmployeeInfService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EmployeeInfServiceImpl extends ServiceImpl<EmployeeInfMapper, EmployeeInf> implements EmployeeInfService {
    @Autowired
    private  EmployeeInfMapper mapper;

    public ResultCode<EmployeeInf> getEmpDate(Integer page, Integer limit) {
//        分页
        IPage i = new Page(page,limit);

        IPage iPage = mapper.selectPage(i,null);

        ResultCode<EmployeeInf> rc = new ResultCode<EmployeeInf>(0,"",(int)iPage.getTotal(),iPage.getRecords());

        return rc;

    }

    public boolean addEmp(EmployeeInf employee) {
        return false;
    }


}
